<?php
namespace Game\Model;
use Think\Model;
/**
 * 自定义页面模型
 */
class GameMapConfigModel extends Model{

    public function save_config_data($data){
        $where['stage_id'] = $data['stage_id'];
        if($this->where($where)->find()){
            $data['update_time'] = date('Y-m-d H:i:s',time());
            $res = $this->where($where)->save($data);
        }else{
            $data['update_time'] = date('Y-m-d H:i:s',time());
            $res = $this->add($data);
        }
        return $res;
    }

    public function get_config_data($stage_id){
        $where['stage_id'] = $stage_id;
        $res = $this->where($where)->find();
        return $res;
    }
}